package com.gt.quality.system.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.experimental.Accessors;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;
/**
 * 操作日志记录(SysOperLog)表实体类
 *
 * @author makejava
 * @since 2026-11-27 16:31:42
 */
@Data
@Accessors(chain = true)
@Schema(title = "SysOperLog", description = "EasyCode")
@TableName(value = "sys_oper_log", autoResultMap = true)
public class SysOperLog implements Serializable {

    @Serial
	private static final long serialVersionUID = 1L;

    /**
     * Description:  日志主键
     */
    @TableId(value = "oper_id", type = IdType.ASSIGN_ID)
    @Schema(title = "oper_id",description = "日志主键")
    @JsonSerialize(using= ToStringSerializer.class)
    private Long operId;

    /**
     * Description:  租户编号
     */
    @TableField(value = "tenant_id")
    @Schema(title = "tenant_id",description = "租户编号")
    private String tenantId;

    /**
     * Description:  模块标题
     */
    @TableField(value = "title")
    @Schema(title = "title",description = "模块标题")
    private String title;

    /**
     * Description:  业务类型（0其它 1新增 2修改 3删除）
     */
    @TableField(value = "business_type")
    @Schema(title = "business_type",description = "业务类型（0其它 1新增 2修改 3删除）")
    private Integer businessType;

    /**
     * Description:  方法名称
     */
    @TableField(value = "method")
    @Schema(title = "method",description = "方法名称")
    private String method;

    /**
     * Description:  请求方式
     */
    @TableField(value = "request_method")
    @Schema(title = "request_method",description = "请求方式")
    private String requestMethod;

    /**
     * Description:  操作类别（0其它 1后台用户 2手机端用户）
     */
    @TableField(value = "operator_type")
    @Schema(title = "operator_type",description = "操作类别（0其它 1后台用户 2手机端用户）")
    private Integer operatorType;

    /**
     * Description:  操作人员
     */
    @TableField(value = "oper_name")
    @Schema(title = "oper_name",description = "操作人员")
    private String operName;

    /**
     * Description:  部门名称
     */
    @TableField(value = "dept_name")
    @Schema(title = "dept_name",description = "部门名称")
    private String deptName;

    /**
     * Description:  请求URL
     */
    @TableField(value = "oper_url")
    @Schema(title = "oper_url",description = "请求URL")
    private String operUrl;

    /**
     * Description:  主机地址
     */
    @TableField(value = "oper_ip")
    @Schema(title = "oper_ip",description = "主机地址")
    private String operIp;

    /**
     * Description:  操作地点
     */
    @TableField(value = "oper_location")
    @Schema(title = "oper_location",description = "操作地点")
    private String operLocation;

    /**
     * Description:  请求参数
     */
    @TableField(value = "oper_param")
    @Schema(title = "oper_param",description = "请求参数")
    private String operParam;

    /**
     * Description:  返回参数
     */
    @TableField(value = "json_result")
    @Schema(title = "json_result",description = "返回参数")
    private String jsonResult;

    /**
     * Description:  操作状态（0正常 1异常）
     */
    @TableField(value = "status")
    @Schema(title = "status",description = "操作状态（0正常 1异常）")
    private Integer status;

    /**
     * Description:  错误消息
     */
    @TableField(value = "error_msg")
    @Schema(title = "error_msg",description = "错误消息")
    private String errorMsg;

    /**
     * Description:  操作时间
     */
    @TableField(value = "oper_time")
    @Schema(title = "oper_time",description = "操作时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime operTime;

    /**
     * Description:  消耗时间
     */
    @TableField(value = "cost_time")
    @Schema(title = "cost_time",description = "消耗时间")
    private Long costTime;

}


